package aqr;

public class PrintPrimes {

	public static void main(String[] args) {
		for(int i=2; i<1000; i++) {
			if(isPrime(i)) {
				System.out.print(i+" "); 
	        }
        }
    }
	
	private static boolean isPrime(int n) {
		for(int i = 2; i <= (int) Math.sqrt(n); i++) {
			if(n%i == 0)
				return false;
		}
		return true;
	}
	
}
